DataSeries Actions... (multiple actions)

Description

Perform actions on a DataSeries, including refreshing a data series or reading a data series.

Discussion

The DataSeries Actions... (multiple actions) Action Javascript action is used to manipulate DataSeries defined in a UX Component. This action is useful with client-side DataSeries.

DataSeries Actions... (multiple actions) can be used to perform the following actions:

  • Refresh the data in one or more Data Series. The action is only meaningful if you specified that your Data Series data should be published to the client-side. An Ajax callback is made and the SQL query or custom Xbasic code that gets the data for the Data Series is executed. The new data is then published to the client-side
  • Read the data in a Data Series and assigns it to a Javascript variable.

Client-side DataSeries

If client-side DataSeries are enabled, the DataSeries data is stored in a JavaScript variable in the UX Component's JavaScript object. The Refresh DataSeries stores the data in the {dialog.object}._dataSeriesData object. The data in a DataSeries can be referenced from JavaScript as follows:

// if the DataSeries has subseries:
{dialog.object}._dataSeriesData.SeriesName.SubSeriesname

// if the DataSeries has no subseries:
{dialog.object}._dataSeriesData.SeriesName

For example, suppose a DataSeries called Series1 has two subseries, Country and Population. The following JavaScript can be used to get the data for each subseries:

var country = {dialog.object}._dataSeriesData.Series1.Country;
var population = {dialog.object}._dataSeriesData.Series1.Population;

DataSeries Action Properties

The following properties are used to configure the DataSeries Actions... (multiple actions) Action Javascript:

Property
Description
Action name

Specify the DataSeries Action to execute. Can be one of the following actions:

Refresh DataSeries

Refresh one or all DataSeries. Only applies if you have published the DataSeries to the client-side.

Read DataSeries

Sets a variable to the data in the specified DataSeries and sub-series.

DataSeries Name

The DataSeries to refresh or read.

Sub-series name

The sub-series to read. Used with the Read DataSeries action.

Variable Name

The name of the JavaScript variable to populate with the DataSeries data. Used with the Read DataSeries action.

Ajax failed Javascript

(Optional) The JavaScript to execute if the Ajax callback to refresh the DataSeries fails (i.e. if the server doesn't send a response.) Used with the Refresh DataSeries action.

Offline Javascript

(Optional) The JavaScript to execute if the device is offline. If the device is offline, no Ajax callback will be made to refresh the DataSeries, and the Ajax failed Javascript function will not be called. Used with the Refresh DataSeries action.

onComplete Javascript

Specify the JavaScript to run once the data has been downloaded. Used with the Refresh DataSeries action.

See Also